I am working in DOORS 8.1, and have a template that I am exporting a requirements document to. In the DOORS version, I have a column labeled SRD# (meant to be the requirements number), and a column that is the requirements, headings, etc.
When I export to Word I currently get:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.2.1 Section Title
SRD#: 001
Requirement 1 Text is then listed here
SRD#: 002
Requirement 2 Text is then listed here
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I would rather it look like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.2.1 Section Title
SRD#: 001 Requirement 1 Text is then listed here
SRD#: 002 Requirement 2 Text is then listed here
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I tried setting up the word template for this, but cannot get a DOORS feature for the SRD# to come up in the style mapping dialog, and am not familiar with writing DXL scripts.
Any ideas?
Kim Eckhardt - Tue Dec 15 11:49:08 EST 2009 |
|
Re: Exporting to Word - Requirements Numbers llandale - Tue Dec 15 12:09:50 EST 2009
Monkeying with the exporter is for clever folks who like to break things so they can fix them. I would simply create an AttrDXL which calculates the value you want to export, then tell the export to export that attribute.
Create attribute "TextExport", type 'text', history/changebars/changedates all off, of AttrDXL. Browse, then start a new DXL. Enter the following.
if (obj is not a requirement)
{ Result =
" "
}
else
{ string Result string Text = richTextWithOle(obj.
"Object Text")
if (
null Text) Result =
" "
else Result =
"SRD#: " obj.
"SRD"
" " Text
} obj.attrDXLName = richText(Result)
Setting Result to a space instead of null is becasuse attr DXL re-calculates when its null, which will cause significant thrashing, much like Layouts slow you down rediculously.
|
|
Re: Exporting to Word - Requirements Numbers Kim Eckhardt - Tue Dec 15 12:38:40 EST 2009 llandale - Tue Dec 15 12:09:50 EST 2009
Monkeying with the exporter is for clever folks who like to break things so they can fix them. I would simply create an AttrDXL which calculates the value you want to export, then tell the export to export that attribute.
Create attribute "TextExport", type 'text', history/changebars/changedates all off, of AttrDXL. Browse, then start a new DXL. Enter the following.
if (obj is not a requirement)
{ Result =
" "
}
else
{ string Result string Text = richTextWithOle(obj.
"Object Text")
if (
null Text) Result =
" "
else Result =
"SRD#: " obj.
"SRD"
" " Text
} obj.attrDXLName = richText(Result)
Setting Result to a space instead of null is becasuse attr DXL re-calculates when its null, which will cause significant thrashing, much like Layouts slow you down rediculously.
Thanks for the really quick response!
I tried what you suggested and had a few issues (Sorry I am VERY new to DXL editing in DOORS)...
I created the new TextExport attribute and followed the directions to create the DXL. The first time I input it and checked it I got a whole bunch of Errors. I edited the first line to read as follows
if (
"SRD" ==
" ")
{ Result =
" "
}
else
{ string Result string Text = richTextWithOle(obj.
"Object Text")
if (
null Text) Result =
" "
else Result =
"SRD#: " obj.
"SRD"
" " Text
} obj.attrDXLName = richText(Result)
But I still get the errors:
-E- DXL: <Line:11> incorrect arguments for function (richText)
-E- DXL: <Line:11> undeclared variable (Result)
-I- DXL: all done with 2 errors and 0 warnings
The reason I substituted SRD==" " is because if that column is blank, its not a requirement, so I figured that met the "obj is not a requirement". If there is a better way I would be happy to do that (just didnt want to have to create another column/attribute Requirement=yes/no.
|
|
Re: Exporting to Word - Requirements Numbers aalmo - Tue Dec 15 14:07:22 EST 2009
This is easy to do with “Find/Replace” in WORD.
I convert
This:
SRD # :
The system
SRD # : 0110
Selection List
SRD # :
When the valid …
SRD # : 0120
Mandatory Fields
To
The system .
SRD# 0110 Selection List
When the valid …
SRD# 0120 Mandatory Fields
With 2 Find/Replace. The first deletes the SRD # blank.
The second converts the SRD# nnn to be on the same line with the next object, different font, and indented left.
|
|
Re: Exporting to Word - Requirements Numbers llandale - Tue Dec 15 15:13:40 EST 2009 Kim Eckhardt - Tue Dec 15 12:38:40 EST 2009
Thanks for the really quick response!
I tried what you suggested and had a few issues (Sorry I am VERY new to DXL editing in DOORS)...
I created the new TextExport attribute and followed the directions to create the DXL. The first time I input it and checked it I got a whole bunch of Errors. I edited the first line to read as follows
if (
"SRD" ==
" ")
{ Result =
" "
}
else
{ string Result string Text = richTextWithOle(obj.
"Object Text")
if (
null Text) Result =
" "
else Result =
"SRD#: " obj.
"SRD"
" " Text
} obj.attrDXLName = richText(Result)
But I still get the errors:
-E- DXL: <Line:11> incorrect arguments for function (richText)
-E- DXL: <Line:11> undeclared variable (Result)
-I- DXL: all done with 2 errors and 0 warnings
The reason I substituted SRD==" " is because if that column is blank, its not a requirement, so I figured that met the "obj is not a requirement". If there is a better way I would be happy to do that (just didnt want to have to create another column/attribute Requirement=yes/no.
I guess you have no coding experience. Try this:
string Result, Text, SRD SRD = obj.
"SRD"
""
if (SRD ==
"")
{ Result =
" "
}
else
{ Text = richTextWithOle(obj.
"Object Text")
if (
null Text) Result =
" "
else Result =
"SRD#: " SRD
" " Text
} obj.attrDXLName = richText(Result)
Or yes, doh!, substitute it in MS-Word.
|
|
Re: Exporting to Word - Requirements Numbers SystemAdmin - Wed Dec 16 01:23:16 EST 2009
Without any DXL coding you can combine attribute values by using the Attribute Wizard: select Edit / Attributes and then "New". Select the Type of attribute to be "Text" and then check the "DXL attribute". The Wizard button is activated allowing you to build one attribute which combines other values into one. In your case you would combine "SRD#" and "Object Text".
|
|
Re: Exporting to Word - Requirements Numbers BennC - Thu Mar 04 19:29:26 EST 2010
What if he had wanted to have the requirement identifier in bold and the text in normal?
Is there an easy way to do that?
|
|
Re: Exporting to Word - Requirements Numbers SystemAdmin - Tue May 25 04:06:16 EDT 2010 BennC - Thu Mar 04 19:29:26 EST 2010
What if he had wanted to have the requirement identifier in bold and the text in normal?
Is there an easy way to do that?
I need to apply different word styles to the ID and the requirement text. Both the items appear on the same line. Any suggestions.
|
|
Re: Exporting to Word - Requirements Numbers llandale - Tue May 25 14:12:42 EDT 2010 SystemAdmin - Tue May 25 04:06:16 EDT 2010
I need to apply different word styles to the ID and the requirement text. Both the items appear on the same line. Any suggestions.
You can bold the identifier in the module, then export it normally. To bold the Identifier, you need to make an attr DXL as follows.
Open the module Edit. Create a new attribute perhaps "dxlIdentifier", turn off History/ChangeBars/ModifiedDate, select DXL Attribute then Browse, New, then paste the following into the white window:
obj.attrDXLName = richText("{\\b " identifier(obj) "\\b0 }")
OK OK OK. In that line of code, be sure the ending \\b0 has a space after it (as does the \\b).
Go to a view and insert attribute dxlIndentifier; export.
Let us know if that works.
|
|
Re: Exporting to Word - Requirements Numbers rmoskwa - Thu Jun 03 16:32:14 EDT 2010
Hi Kim,
This may be crude, but maybe you can Export To Word with Table Layout. You'll get a table in Word, but you can then convert the table to text in Word.
|
|